package com.servlet;

import com.util.UtilJdbc;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class AppFormServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String na=req.getParameter("name");

        req.getRequestDispatcher("/page/AppForm.jsp").forward(req,resp);
        String uname=req.getParameter("uname");

        UtilJdbc utilJdbc=new UtilJdbc();
        utilJdbc.join(uname,na);
        req.getRequestDispatcher("/page/ApplyRight.jsp").forward(req,resp);

    }
}
